package com.gome.han.bigdata.mr._001_wordcount;

import java.io.File;
import java.net.URL;

/**
* @author hanpeng
* @version 创建时间：2020年11月24日 下午8:55:23
* @ClassName 类名称
* @Description 类描述
*/
public class PathTest {
	public static void main(String[] args) {
//		System.out.println(ClassLoader.getSystemResource(""));
//		System.out.println(PathTest.class.getResource(""));//file:/C:/devSoft/java/workspacetianqiong/bigdata/mapreduce/target/classes/com/gome/han/bigdata/mr/_001_wordcount/
//		System.out.println(PathTest.class.getClassLoader().getResourceAsStream(""));
//		InputStream is = PathTest.class.getClassLoader().getResourceAsStream("hello.txt");
		//URL resource = WordcountDriver.class.getResource("hello.txt");
//		String realPath = PathTest.class.getClassLoader().
//				.getPath()+"hello.txt";
//		System.out.println(realPath);
		System.out.println(PathTest.class.getResource("").getPath());
		File f = new File(PathTest.class.getResource("").getPath()+"hello.txt");
		System.out.println(f.isFile());


		System.out.println("f = " + f);


	}
}




















